<?php
declare (strict_types = 1);

namespace app\model\table\season;

use app\model\BaseModel;
use app\model\table\union\Union;
use app\model\table\user\User;

/**
 * @mixin \think\Model
 */
class SeasonScoreLog extends BaseModel
{
    protected $table = 'app_season_score_log';

    // 是否全表缓存到redis
    public $tableToRedis = false;

    // 该表缓存到redis的策略
    public $tableToRedisKey = [];

    public $joinWithList=array(
        'UserInfo'=>array(
            'selfColumn'=>'user_id',
            'joinObj'=> User::class,
            'joinColumn'=>'id',
            'selectColumn'=>'id,name'
        ),
        'UnionInfo'=>array(
            'joinBefore' => 'UserInfo',
            'selfColumn'=>'UserInfo.union_id',
            'joinObj'=> Union::class,
            'joinColumn'=>'id',
            'selectColumn'=>'id,name,icon'
        ),
        'SeasonConfigInfo'=>array(
            'selfColumn'=>'season_id',
            'joinObj'=> SeasonConfig::class,
            'joinColumn'=>'id',
            'selectColumn'=>'id,name'
        ),
    );

    /**
     * 刷新赛季排行榜
     * @return void
     */
    public function flushSeasonScoreLog()
    {
        // 首先获取当前赛季
    }
}
